﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ELS.User
{
    class GrantController
    {
        GrantDataAccess grantDataAccess = new GrantDataAccess();
        internal void UpdatePermissionOfGroup(string currentGroupId, List<int> newPermissions)
        {
            bool isDeleteSuccess = grantDataAccess.DeleTeAllPermissionOfGroup(currentGroupId) > 0;
            if (isDeleteSuccess)
            {
                bool isInsertSuccess = grantDataAccess.InsertNewPermissionOfGroup(currentGroupId, newPermissions) > 0;
            }
        }
    }
}
